package com.cloud.DrugManagement.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cloud.DrugManagement.pojo.ReceiptMonocular;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

/**
 * @author zhozixiong
 * @date 2023/02/17
 */
@Mapper
@Repository
public interface ReceiptMonocularMapper extends BaseMapper<ReceiptMonocular> {

    Page<ReceiptMonocular> searchNotSubmit(Page page, @Param("oid") Long oid);

    Page<ReceiptMonocular> searchSubmit(Page page, @Param("oid") Long oid);

    ReceiptMonocular searchAllByOidAndDid(@Param("oid") Long oid, @Param("did") int did);

    Double searchTotalAmount(@Param("oid") Long oid);

    int insert(@Param("oid") Long oid, @Param("did") int did, @Param("quantity") int quantity);

    int updateQuantityAndMoneyByOidAndDid(@Param("quantity") int quantity, @Param("oid") Long oid, @Param("did") int did);
}
